﻿using Microsoft.Phone.Controls;

namespace Budgetsch.WP7.View
{
    using System.Windows.Navigation;

    using Budgetsch.WP7.ViewModel.Income;

    using GalaSoft.MvvmLight.Ioc;

    /// <summary>
    /// Description for IncomeView.
    /// </summary>
    public partial class IncomeView
    {

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            listBox.SelectedIndex = -1;
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            listBox.SelectedIndex = -1;
        }

        /// <summary>
        /// Initializes a new instance of the IncomeView class.
        /// </summary>
        public IncomeView()
        {
            InitializeComponent();
            var vm = SimpleIoc.Default.GetInstance<IncomeViewModel>();
            vm.GetIncomes();
        }
    }
}